<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head lang="en">
    <meta charset="UTF-8"/>
    <title>微分享-用户登陆</title>
    <link rel="stylesheet" th:href="@{/static/assets/css/amazeui.min.css}"/>
    <style>
        .header {
            text-align: center;
        }

        .header h1 {
            font-size: 200%;
            color: #333;
            margin-top: 30px;
        }

        .header p {
            font-size: 14px;
        }
    </style>
    <script th:src="@{/static/assets/js/jquery.min.js}"></script>
    <script th:src="@{/static/assets/js/amazeui.min.js}"></script>
    <script th:src="@{/static/assets/js/app.js}"></script>
	<script type= "text/javascript" th:src ="@{/static/lib/layer/layer.js}"></script>   
	<script type= "text/javascript" th:src ="@{/dwr/util.js}"></script>   
	<script type="text/javascript" th:src= "@{/dwr/engine.js}"></script > 
	<script type="text/javascript" th:src= "@{/dwr/interface/NoticeContentController.js}"></script>
	<script type="text/javascript" th:src= "@{/static/js/dwrhelp.js}"></script>
    <script th:src="@{/static/js/public.js}"></script>
    <script>
    /*<![CDATA[*/
        function login() {
    	postReturnJson("/login", {
            userName: $("#code").val(),
            password: $("#password").val()
        },function (msg) {
        	console.info(msg);
        	 if (msg.success) {
                 window.sessionStorage.setItem("loginUsername", $("#code").val());
                 window.location.href = 'all_share';
             } else {
                 $("#error_message").html(msg.msg);
             }
    	});
        }
        /*]]>*/
    </script>
</head>
<body>
<div class="header">
    <div class="am-g">
        <h1>微分享系统</h1>
    </div>
    <hr/>
</div>
<div class="am-g">
    <div class="am-u-lg-6 am-u-md-8 am-u-sm-centered">
        <form method="post" class="am-form">
            <label>用户名:</label>
            <input type="text" code="" id="code" value=""/>
            <label for="password">密码:</label>
            <input type="password" code="" id="password" value=""/>
            <div class="am-cf">
                <input onclick="login()" type="button" code="" value="登 录"
                       class="am-btn am-btn-primary am-btn-sm am-fl"/>&nbsp;
                <input onclick="window.location.href='normal_register'" type="button" code="" value="注 册"
                       class="am-btn am-btn-primary am-btn-sm am-fl"/>
				<input onclick="window.location.href='login'" style='background-color:red' type="button" code="" value="管理员登陆"
                       class="am-btn am-btn-primary am-btn-sm am-fl"/>&nbsp;
                <input onclick="window.location.href='all_share'" style='background-color:gray' type="button" code="" value="游客浏览"
                       class="am-btn am-btn-primary am-btn-sm am-fl"/>
            </div>
            <span id="error_message" style="color: red"></span>
        </form>
        <p>周航@成都信息工程大学, All Rights Reserved.</p>
    </div>
</div>
</body>
</html>
